#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QLocale>
#include <QTranslator>
#include <QtDeclarative>

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());

    QTranslator tradutor;
    if (QLocale::system().name() != "pt_BR") {
        if (tradutor.load("NumEmOrdem_en", ":/traducoes")) {
            app->installTranslator(&tradutor);
            viewer->rootContext()->setContextProperty("local", "ingles");
        } else {

        }
    } else {
        if (tradutor.load("NumEmOrdem_br", ":/traducoes")) {
            app->installTranslator(&tradutor);
        } else {

        }
        viewer->rootContext()->setContextProperty("local", "brasil");
    }
    viewer->setMainQmlFile(QLatin1String("qml/NumEmOrdem/main.qml"));    
    viewer->setAttribute(Qt::WA_LockPortraitOrientation);
    viewer->showExpanded();

    return app->exec();
}
